/**
 * Created by Administrator on 2017/8/30.
 */
import * as types from '../mutation-types'
import sellerService from '../../services/staff'

// initial state
const state = {
  currentStaff: {}
}

// getters
const getters = {}

// actions
const actions = {
  loadCurrentStaff({commit}) {
    return new Promise((resolve, reject) => {
      sellerService.loadCurrentStaff(function (data) {
        commit(types.LOAD_CURRENT_STAFF, data);
        resolve();
      });
    })
  }
}

// mutations
const mutations = {
  [types.LOAD_CURRENT_STAFF] (state, data) {
    state.currentStaff = data.data;
  }
}

export default {
  state,
  getters,
  actions,
  mutations
}
